<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
</html>

<script type="text/javascript">
	const list = [
		{username: 'zjn',age: 18},
		{username: 'lcq',age: 19},
		{username: 'yzw',age: 20},
		{username: 'gyj',age: 21}
	]
	
	for (let key of list.keys()) {
		// 获取数组的下标
		console.log('key',key);
	}
	
	for (let value of list.values()) {
		// 获取数组的成员
		console.log('value',value);
	}
	console.log('............');
	// 简洁写法
	for (let value of list) {
		console.log(value);
	}
	
	
	for (let entry of list.entries()) {
		// 获取数组每个成员的下标和成员
		console.log(entry);
		// console.log(entry[0]); // 取成员的下标
		// console.log(entry[1]); // 获取成员本身
	}
	
	
	
</script>
